package com.pt25.study.example.repository.sharding.persistence.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pt25.base.model.monitor.sql.SqlPerformance;
import com.pt25.study.example.domain.sharding.ddo.ShardingMs;
import com.pt25.study.example.repository.sharding.converter.ShardingConverter;
import com.pt25.study.example.repository.sharding.mapper.ShardingMsMapper;
import com.pt25.study.example.repository.sharding.persistence.ShardingMsRepo;
import com.pt25.study.example.repository.sharding.po.ShardingMsPo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class ShardingMsRepoImpl extends ServiceImpl<ShardingMsMapper, ShardingMsPo> implements ShardingMsRepo {

    @SqlPerformance
    @Override
    public ShardingMs getShardingMs(Long id) {
        return ShardingConverter.ShardingMSPO2ShardingMS(getById(id));
    }
}
